var finishedStatusIndex = new Array (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);

function createXMLHttpObject(){
	var obj = null;
	if(window.ActiveXObject)
		obj= new ActiveXObject("Microsoft.XMLHTTP");
	else if(window.XMLHttpRequest){
		obj= new XMLHttpRequest();
		
	}
	//CEK isis XMLHttp
	if(obj == null)
		document.write("Browser tidak mendukung XMLHttpRequest");
	return obj;
}

function processData(XMLObject, url, var_nilai, id_elemen, indexStatus){
	if(XMLObject != null){
		var obj= document.getElementById(id_elemen);
		XMLObject.open("POST", url);
		
		var contentType= "application/x-www-form-urlencoded";//alert("1not null | "+url);	
		XMLObject.setRequestHeader("Content-Type", contentType);//alert("2not null | "+url);	
		
		finishedStatusIndex[indexStatus]= 0;
		
		XMLObject.onreadystatechange = function (){
			if(XMLObject.readyState==4) {
				if(XMLObject.status==200){
					$("#"+id_elemen).fadeOut("fast");
					setTimeout(function(){
						obj.innerHTML= XMLObject.responseText;
						finishedStatusIndex[indexStatus]= 1;
					
						$("#"+id_elemen).fadeIn("fast");
					}, 500);
					return true;
				}
			}
			else{
				obj.innerHTML= '<img src="lib/core/images/loader.gif" alt="loading.." width="16" height="16" />';
			}
		}
		XMLObject.send(var_nilai);
	}
}


function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	} else if (obj.x){
		curleft += obj.x;
	}
	return curleft;
}

function findPosY(obj){
	var curtop = 0;

	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	} else if (obj.y){
		curtop += obj.y;
	}
	return curtop;
}

